//
//  DrawView.m
//  30203
//
//  Created by student on 16/4/6.
//  Copyright © 2016年 niit. All rights reserved.
//

#import "DrawView.h"

@implementation DrawView

-(void)setPoint:(CGPoint)point
{
    _point = point;
    [self setNeedsDisplay];
}
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    CGPoint center = CGPointMake(rect.size.width/2, rect.size.height/2);
    CGFloat radius = rect.size.width/2 -15;
    
    //画图
    UIBezierPath *path = [UIBezierPath bezierPathWithArcCenter:center radius:radius startAngle:0 endAngle:M_PI*2 clockwise:YES];
    path.lineWidth = 10;
    [[UIColor blueColor] setStroke];
    [path stroke];
    //yanjing
    UIBezierPath *path2 = [UIBezierPath bezierPathWithArcCenter:CGPointMake(120, 100) radius:60     startAngle:0 endAngle:M_PI*2 clockwise:YES];
    path2.lineWidth = 10;
    [[UIColor blueColor] setStroke];
    [path2 stroke];

    UIBezierPath *path3 = [UIBezierPath bezierPathWithArcCenter:CGPointMake(250, 100) radius:60     startAngle:0 endAngle:M_PI*2 clockwise:YES];
    path3.lineWidth = 10;
    [[UIColor blueColor] setStroke];
    [path3 stroke];
    
    UIBezierPath *curvePath = [UIBezierPath bezierPath];
    [curvePath moveToPoint:CGPointMake(100, 250)];
    [curvePath addQuadCurveToPoint:CGPointMake(275, 250) controlPoint:self.point];
    curvePath.lineWidth = 10;
    [curvePath stroke];
}



@end
